Delay configuring the new domain during migration to localhost.
self.dst_port,
self.live ])
- def xfr_vm_suspend(self, xfrd, val):
- def cbok(val):
- # Special case for localhost: destroy devices early.
- if self.dst_host in ["localhost", "127.0.0.1"]:
- self.dominfo.restart_cancel()
- self.dominfo.cleanup()
- self.dominfo.destroy_console()
- return val
+## def xfr_vm_suspend(self, xfrd, val):
+## def cbok(val):
+## # Special case for localhost: destroy devices early.
+## if self.dst_host in ["localhost", "127.0.0.1"]:
+## self.dominfo.restart_cancel()
+## self.dominfo.cleanup()
+## self.dominfo.destroy_console()
+## return val
- d = XfrdInfo.xfr_vm_suspend(self, xfrd, val)
- d.addCallback(cbok)
- return d
+## d = XfrdInfo.xfr_vm_suspend(self, xfrd, val)
+## d.addCallback(cbok)
+## return d
def xfr_migrate_ok(self, xfrd, val):
dom = int(sxp.child0(val))
ioctxt->info = iostdout;
ioctxt->err = iostderr;
ioctxt->configure = domain_configure;
- ioctxt->flags |= XCFLAGS_CONFIGURE;
+ if(!configured){
+ ioctxt->flags |= XCFLAGS_CONFIGURE;
+ }
err = xc_linux_restore(xcinit(), ioctxt);
*dom = ioctxt->domain;
Sxpr sxpr;
int configured=0;
- dprintf(">\n");
+ dprintf("> peer=%s\n", inet_ntoa(peer->addr.sin_addr));
+ // If receiving from localhost set configured so that that xen_domain_rcv()
+ // does not attempt to configure the new domain. This is because the old
+ // domain still exists and will make it fail.
+ if(peer->addr.sin_addr.s_addr == htonl(INADDR_LOOPBACK)){
+ dprintf("> Peer is localhost\n");
+ configured = 1;
+ }
err = xen_domain_rcv(peer->in,
&state->vmid_new,
&state->vmconfig, &state->vmconfig_n,
err = Conn_sxpr(peer, &sxpr);
if(err) goto exit;
if(!configured){
+ dprintf("> Configuring...\n");
err = xen_domain_configure(state->vmid_new, state->vmconfig, state->vmconfig_n);
if(err) goto exit;
}
int long_index = 0;
static const char * LOGFILE = "/var/log/xfrd.log";
+#ifndef DEBUG
freopen(LOGFILE, "w+", stdout);
fclose(stderr);
stderr = stdout;
+#endif
dprintf(">\n");
set_defaults(args);
while(1){